package com.mmd.common.enums;

import java.util.Objects;

public enum BillTypeEnums {
    CONSUMER(1, "消费"),
    CHARGE(2, "充值"),
    ORDER(3, "客户下单");

    private BillTypeEnums(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static BillTypeEnums getUserTypeEnum(Integer code) {
        BillTypeEnums[] enumArr = BillTypeEnums.values();
        for (BillTypeEnums e : enumArr) {
            if (Objects.equals(e.getCode(), code)) {
                return e;
            }
        }
        return null;
    }

    private Integer code;
    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
